/* Universidad del Valle de Guatemala
 * Sara López 12050
 * Matías Vasquez 12186
 * Sección: 21
 * Clase Node
 */


public class Node<T> implements Comparable<Node<T>> {
    
    
        //Utiliza Comparable para ir realizando las comparaciones correspondientes
    
    
        protected T data;
        protected boolean visited;
        public Integer index = null;
        public Integer lowlink = null;
        public double distance = Double.POSITIVE_INFINITY;
        public Node<T> predecessor = null;
       
        public Node(T data) {
                this.data = data;
        }
       
        public Node() {
               
        }
    
        //Regresa cuales han sido visitadas
        public boolean isVisited() {
                return visited;
        }
       
        public void visit() {
                visited = true;
        }
       
        public void unvisit() {
                visited = false;
        }
       
        public int compareTo(Node<T> ob) {
                String tempA = this.toString();
                String tempB = ob.toString();
               
                return tempA.compareTo(tempB);
        }
       
        public String toString() {
                return data.toString();
        }
       
}
